package com.webshop.app.controller;

import javax.ejb.EJB;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;

import com.webshop.app.dao.OrderDAO;
import com.webshop.app.entity.Order;

@ManagedBean
@RequestScoped
public class OrderController {
	
	private Order order;
	@EJB
	private OrderDAO orderDao;
	
	
	public Order getOrder() {
		return order;
	}

	public void setOrder(Order order) {
		this.order = order;
	}

	public OrderDAO getOrderDao() {
		return orderDao;
	}


	public void setOrderDao(OrderDAO orderDao) {
		this.orderDao = orderDao;
	}


	public String doCreateOrder(Order order){
		order = orderDao.createOrder(order);
		return "orderCreated.xhtml";
		
	}

}
